﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using KPIS.GERP.GFMS.MODEL;
using KPIS.GERP.GFMS.IBLL;
using KPIS.GERP.GFMS.IDAL;
using KPIS.GERP.GFMS.DALFactory;

namespace KPIS.GERP.GFMS.BLL
{
    public class B_FIM_MAS_ReceiveTypes : IBLL_FIM_MAS_ReceiveTypes
    {
        Common common = new Common();
        private static readonly IDAL_FIM_MAS_ReceiveTypes dal = DataAccess.Create_FIM_MAS_ReceiveTypes();

        public B_FIM_MAS_ReceiveTypes()
        {

        }

        public IList<M_FIM_MAS_ReceiveTypes> GetFull(string bgm_source_seq)
        {
            Nullable<int> nbgm_source_seq = common.ConvertNullInt(bgm_source_seq);
            return dal.GetFull(nbgm_source_seq);
        }

        public IList<M_FIM_MAS_ReceiveTypes> GetList(string bgm_source_seq)
        {
            Nullable<int> nbgm_source_seq = common.ConvertNullInt(bgm_source_seq);
            return dal.GetFull(nbgm_source_seq);
        }

        public M_FIM_MAS_ReceiveTypes GetInfo(string seq)
        {
            int nSeq;
 
            if (seq == null)
                return null;

            if (common.IsNumeric(seq))
            {
                nSeq = int.Parse(seq);
                return dal.GetInfo(nSeq);
            }
            else
            {
                return null;
            }
        }

        public void Insert(M_FIM_MAS_ReceiveTypes info)
        {
            try
            {
                dal.Insert(info);
            }
            catch
            {
                throw;
            }
        }

        public void Update(M_FIM_MAS_ReceiveTypes info)
        {
            try
            {
                dal.Update(info);
            }
            catch
            {
                throw;
            }
        }

        public void Delete(M_FIM_MAS_ReceiveTypes info)
        {
            try
            {
                dal.Delete(info);
            }
            catch
            {
                throw;
            }
        }
    }
}
